package com.itheima.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class AOPAdvice2 {
    @Pointcut("execution(* *..*(..))")
    public void pc() {
    }

    /*通知：共性*/
    @Before("pc()")
    public void before(JoinPoint jp) {
        Object[] args = jp.getArgs();
        System.out.println("before 共性功能...2:"+args[0]);
    }

    @After("pc()")
    public void after(JoinPoint jp) {
        Object[] args = jp.getArgs();
        System.out.println("after2:"+args[0]);
    }


}
